﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class KylinSceneLoaderWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(Kylin.SceneLoader);
			Utils.BeginObjectRegister(type, L, translator, 0, 1, 0, 0);
			
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadScene", _m_LoadScene);
			
			
			
			
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
			
			
            
			
			
			
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 1)
				{
					
					var gen_ret = new Kylin.SceneLoader();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
			}
            return LuaAPI.luaL_error(L, "invalid arguments to Kylin.SceneLoader constructor!");
            
        }
        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_LoadScene(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                Kylin.SceneLoader gen_to_be_invoked = (Kylin.SceneLoader)translator.FastGetCSObj(L, 1);
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 7&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)&& translator.Assignable<System.Action>(L, 4)&& translator.Assignable<System.Action<int>>(L, 5)&& translator.Assignable<System.Action>(L, 6)&& translator.Assignable<System.Action<string>>(L, 7)) 
                {
                    string _sceneName = LuaAPI.lua_tostring(L, 2);
                    bool _additive = LuaAPI.lua_toboolean(L, 3);
                    System.Action _funcStart = translator.GetDelegate<System.Action>(L, 4);
                    System.Action<int> _funcUpdate = translator.GetDelegate<System.Action<int>>(L, 5);
                    System.Action _funcComplete = translator.GetDelegate<System.Action>(L, 6);
                    System.Action<string> _error = translator.GetDelegate<System.Action<string>>(L, 7);
                    
                    gen_to_be_invoked.LoadScene( _sceneName, _additive, _funcStart, _funcUpdate, _funcComplete, _error );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 6&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)&& translator.Assignable<System.Action>(L, 4)&& translator.Assignable<System.Action<int>>(L, 5)&& translator.Assignable<System.Action>(L, 6)) 
                {
                    string _sceneName = LuaAPI.lua_tostring(L, 2);
                    bool _additive = LuaAPI.lua_toboolean(L, 3);
                    System.Action _funcStart = translator.GetDelegate<System.Action>(L, 4);
                    System.Action<int> _funcUpdate = translator.GetDelegate<System.Action<int>>(L, 5);
                    System.Action _funcComplete = translator.GetDelegate<System.Action>(L, 6);
                    
                    gen_to_be_invoked.LoadScene( _sceneName, _additive, _funcStart, _funcUpdate, _funcComplete );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 5&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)&& translator.Assignable<System.Action>(L, 4)&& translator.Assignable<System.Action<int>>(L, 5)) 
                {
                    string _sceneName = LuaAPI.lua_tostring(L, 2);
                    bool _additive = LuaAPI.lua_toboolean(L, 3);
                    System.Action _funcStart = translator.GetDelegate<System.Action>(L, 4);
                    System.Action<int> _funcUpdate = translator.GetDelegate<System.Action<int>>(L, 5);
                    
                    gen_to_be_invoked.LoadScene( _sceneName, _additive, _funcStart, _funcUpdate );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 4&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)&& translator.Assignable<System.Action>(L, 4)) 
                {
                    string _sceneName = LuaAPI.lua_tostring(L, 2);
                    bool _additive = LuaAPI.lua_toboolean(L, 3);
                    System.Action _funcStart = translator.GetDelegate<System.Action>(L, 4);
                    
                    gen_to_be_invoked.LoadScene( _sceneName, _additive, _funcStart );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)) 
                {
                    string _sceneName = LuaAPI.lua_tostring(L, 2);
                    bool _additive = LuaAPI.lua_toboolean(L, 3);
                    
                    gen_to_be_invoked.LoadScene( _sceneName, _additive );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to Kylin.SceneLoader.LoadScene!");
            
        }
        
        
        
        
        
        
		
		
		
		
    }
}
